Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webpack): don't use deprecated config with isolatedConfig #14802

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

danr-za
Copy link
Contributor

@danr-za danr-za commented Feb 4, 2023

Current Behavior

When running a webpack dev server, the webpack configuration is built with the "old" way by using withNx and withWeb even though isolatedConfig is set to true.
The main issue with that is that if a user return an immutable config from one of his plugins together with withNx and withWeb it will run them twice because processed is caching it by reference.

The following example will run withNx and withWeb twice, resulting in duplicated plugins and other invalid configurations:

import { merge } from 'webpack-merge'

const myPlugin: NxWebpackPlugin = (config) => {
  return merge(config, { node: { global: true }})
}

export default composePlugins(myPlugin, withNx(), withWeb(), withReact())

BTW - immutability is anyway an issue with the current tracking.

Expected Behavior

Should respect isolatedConfig in dev server too

Related Issue(s)

Fixes #

@vercel
Copy link

vercel bot commented Feb 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
nx-dev ⬜️ Ignored (Inspect) Feb 5, 2023 at 10:28AM (UTC)

@danr-za danr-za force-pushed the fix/webpack-dev-server-config branch from 04c313d to f12b3d7 Compare February 5, 2023 10:27
@danr-za
Copy link
Contributor Author

danr-za commented Feb 6, 2023

@jaysoo @mandarini

@mandarini mandarini requested a review from jaysoo February 6, 2023 18:28
@mandarini mandarini merged commit 5551fcc into nrwl:master Feb 7, 2023
@danr-za danr-za deleted the fix/webpack-dev-server-config branch February 7, 2023 16:40
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants